package com.loiot.baqi.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.loiot.baqi.pojo.ZpRecommendFlowRollbackList;

/**
 * 企业对接人流程驳回 访问层。
 * 
 * @author  wangzx 
 * @creation 2016-04-22
 */
@Repository("zpRecommendFlowRollbackListDao")
public class ZpRecommendFlowRollbackListDao extends SqlSessionDaoSupport{
    
    /**
     * 添加 企业对接人流程驳回
     * 
     * @param p 参数对象
     */
    public ZpRecommendFlowRollbackList addZpRecommendFlowRollbackList(ZpRecommendFlowRollbackList p)throws Exception {
        this.getSqlSession().insert("ZpRecommendFlowRollbackList.addZpRecommendFlowRollbackList", p);
        return p;
    }
    
    /**
     * 修改 企业对接人流程驳回
     * 
     * @param p 参数对象
     */
    public void updateZpRecommendFlowRollbackList(ZpRecommendFlowRollbackList p)throws Exception {
        this.getSqlSession().update("ZpRecommendFlowRollbackList.updateZpRecommendFlowRollbackList", p);
    }
    
    /**
     * 修改 企业对接人流程驳回
     * 
     * @param p 参数对象
     */
    public void updateZpRecommendFlowRollbackList(HashMap<String,Object> pMap)throws Exception {
        this.getSqlSession().update("ZpRecommendFlowRollbackList.updateZpRecommendFlowRollbackListByMap", pMap);
    }
    
    
    
    /**
     * 删除  企业对接人流程驳回
     * 
     * @param id 主键
     */
    public void deleteZpRecommendFlowRollbackList(java.lang.Long id)throws Exception {
        getSqlSession().delete("ZpRecommendFlowRollbackList.deleteZpRecommendFlowRollbackList", id);
    }
    
    /**
     * 删除  企业对接人流程驳回
     * 
     * @param id 主键
     */
    public void deleteZpRecommendFlowRollbackList(ZpRecommendFlowRollbackList p)throws Exception {
        getSqlSession().delete("ZpRecommendFlowRollbackList.deleteZpRecommendFlowRollbackList", p);
    }
    
    /**
     * 获得  企业对接人流程驳回
     * 
     * @param id 企业对接人流程驳回Id
     * 
     * @return 返回与ID匹配的企业对接人流程驳回
     */
    public ZpRecommendFlowRollbackList getZpRecommendFlowRollbackListById(java.lang.Long id)throws Exception {
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put("rollbackId", id);
    	return (ZpRecommendFlowRollbackList) getSqlSession().selectOne("ZpRecommendFlowRollbackList.getZpRecommendFlowRollbackListById", pMap);
    }
    
    /**
     * 获得  企业对接人流程驳回
     * 
     * @param id 企业对接人流程驳回Id
     * 
     * @return 返回与ID匹配的企业对接人流程驳回
     */
    public ZpRecommendFlowRollbackList getZpRecommendFlowRollbackListById(java.lang.Long id,Long accountId)throws Exception {
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put("rollbackId", id);
    	pMap.put("inPerson", accountId);
    	return (ZpRecommendFlowRollbackList) getSqlSession().selectOne("ZpRecommendFlowRollbackList.getZpRecommendFlowRollbackListById", pMap);
    }
    
    /**
     * 获得  企业对接人流程驳回
     * 
     * @param id 企业对接人流程驳回Id
     * 
     */
    public ZpRecommendFlowRollbackList getZpRecommendFlowRollbackList(HashMap<String,Object> pMap)throws Exception {
    	return (ZpRecommendFlowRollbackList) getSqlSession().selectOne("ZpRecommendFlowRollbackList.queryZpRecommendFlowRollbackListList", pMap);
    }
    
    /**
     * 获得  企业对接人流程驳回
     * 
     * @param name 企业对接人流程驳回名称
     * 
     * @return 返回与NAME匹配的企业对接人流程驳回
     */
    public ZpRecommendFlowRollbackList getZpRecommendFlowRollbackListByName(String name)throws Exception {
        return null;
        //return (ZpRecommendFlowRollbackList) getSqlSession().selectOne("ZpRecommendFlowRollbackList.getZpRecommendFlowRollbackListByName", name);
    }
    
    
    
    /**
     * 查询  企业对接人流程驳回列表条数
     * 
     * @param name 企业对接人流程驳回名称
     * @return 企业对接人流程驳回列表条数
     */
    
    public int getZpRecommendFlowRollbackListListCount(HashMap<String,Object> pMap)throws Exception {
        return (Integer) getSqlSession().selectOne("ZpRecommendFlowRollbackList.getZpRecommendFlowRollbackListListCount", pMap);
    }

    /**
     * 查询 企业对接人流程驳回列表
     * 
     * @param name 企业对接人流程驳回名称
     * @param skipResults 跳过的记录数
     * @param maxResults 最大的记录数
     * @return 企业对接人流程驳回列表
     */
    public List<ZpRecommendFlowRollbackList> queryZpRecommendFlowRollbackListList(HashMap<String, Object> pMap, int skipResults, int maxResults)throws Exception {
    	pMap.put("skipResults", skipResults);
    	pMap.put("maxResults", maxResults);
        return getSqlSession().selectList("ZpRecommendFlowRollbackList.queryZpRecommendFlowRollbackListList", pMap);
    }
    
    /**
     * 查询 企业对接人流程驳回列表
     * 
     * @param pMap 参数列表
     */
    public List<ZpRecommendFlowRollbackList> queryZpRecommendFlowRollbackListList(HashMap<String, Object> pMap)throws Exception {
        return getSqlSession().selectList("ZpRecommendFlowRollbackList.queryZpRecommendFlowRollbackListList", pMap);
    }
    
    /**
     * 查询 企业对接人流程驳回列表
     * 
     * @return 企业对接人流程驳回列表
     */
    public List<ZpRecommendFlowRollbackList> queryZpRecommendFlowRollbackListList()throws Exception {
        Map<String, Object> params = new HashMap<String, Object>();
        return getSqlSession().selectList("ZpRecommendFlowRollbackList.queryZpRecommendFlowRollbackListList",params);
    }
    
    /**
     * 查询 企业对接人流程驳回列表
     * 
     * @return 企业对接人流程驳回列表
     */
    public List<ZpRecommendFlowRollbackList> queryZpRecommendFlowRollbackListList(ZpRecommendFlowRollbackList p )throws Exception {
        return getSqlSession().selectList("ZpRecommendFlowRollbackList.queryZpRecommendFlowRollbackListList",p);
    }
    
    /**
     * 统计 企业对接人流程驳回列表
     * 
     * @return 企业对接人流程驳回列表
     */
    public List<HashMap<String,Object>> statisticsZpRecommendFlowRollbackListInfo(HashMap<String, Object> pMap )throws Exception {
    	List<HashMap<String,Object>> p = null; 
    	p =(List)getSqlSession().selectList("ZpRecommendFlowRollbackList.statisticsZpRecommendFlowRollbackListInfo",pMap);
    	return p;
    }
    
    
    
    

}
